The entry point type is wrong: BOOL is not the same as bool (see DllMain on MSDN). This is not Visual Basic but Visual C++.
You need to pass an additional option to the compiler to tell it to link as a DLL and not to link an executable image. A minimal example would be:
#include <windows.h>
BOOL WINAPI DllMain(HANDLE hInst, DWORD dwReason, LPVOID lpReserved)
{
return TRUE;
}
BOOL WINAPI MyFunction(int value)
{
return TRUE;
}
and compile with cl /nologo /W3 /Ox /Zi /MD /LD test.cpp
to get a test.dll out. The /Zi gets you symbols in a .pdb file.