In all honesty you dont ned a .h file at all. Its just a convienence factor. What you DO need is in the DLL project itself your functions need defined as
void __declspec(dllexport) myFunction();
and in the project using those functions you need a declaration in the form of
void __declspec(dllimport) myFunction();
And that is what this header does. In fact,
dllexport is the only thing needed to build a DLL at all.
DllMain() is entirely optional and useless (I even consider it harmful), and
dllimport is only a compiler optimisation.
What you do need, however, is a
consistent way to declare your functions and variables for both the library and a program using the library -- at least, if you plan to do anything more serious than "Hello DLL".
This is what the macro is about, it adds
dllexport where it's needed, and only there, and leaves everything else intact and in sync.