You create a Win32 project and specify DLL.
If you declare your classes/functions as _declspec(dllexport) then that class will be exported. If you declare your classes/functions as _declspec(dllimport) then that class will be imported.
So you want to use export in the header for creating the DLL and import when you are using the header. In order to use the same header you could do this:
Code:
#ifdef DLL_EXPORTS
#define DLL_API __declspec(dllexport)
#else
#define DLL_API __declspec(dllimport)
#endif
class DLL_API MyClass { };
If you are creating the DLL then define DLL_EXPORTS inside of your preprocessor options for your project. When you are using the DLL this will not be defined and so the classes/functions will be imported.
You load a DLL using LoadLibrary and then you can gain function pointers to various functions inside of the DLL. But if you want to use a class from a DLL you just do what I instructed, include the correct header, link with the import lib that was created when you made the DLL, and you can use the class just like a normal C++ class.