There's a good article about that:
Step by Step: Calling C++ DLLs from VC++ and VB - Part 1[
^]
But, to summarize:
extern is used to use a variable outside the h/cpp file you declared.
You have to declare it TWICE. Once in the .h file (extern int itest;) and once in a cpp file (int itest;).
The classes and functions are compiled from the dll as _declspec(dllexport). and from the project as __declspec(dllimport).
To use only one file, defines are used and relative paths (../ refers to the parent folder of the file).
Finally, for the project or dll to "know" the dll, you must link the .lib file of the dll in the linker properties.
Hope it helps.