You can add the declspec to the function prototype. You probably also wish to use extern "C" to avoid C++ name mangling and __stdcall to allow Visual Basic to call your DLL.
So:
Code:
int xorString(char * szIn);
becomes
Code:
extern "C" DLLIMPORT int __stdcall xorString(char * szIn);
You may wish to combine this into a macro:
Code:
#define DLLFUNCTION(retType) extern "C" DLLIMPORT retType __stdcall
which you can use:
Code:
DLLFUNCTION(int) xorString(char * szIn);
Make sure BUILDING_DLL is defined when you compile your DLL.