Header files (.h) contain C/C++ statements and are used as input to the compiler.
http://en.wikipedia.org/wiki/Header_filesLibrary files (.lib) contain object code and are used as input to the linker.
http://en.wikipedia.org/wiki/Library_%28computer_science%29Very simplistically, a header file can be used to provide the declaration of a function while the lib file can be used to provide the implementation of the function. So, for example, a math.h file might describe an add function that takes two int parameters and returns an int result.
| | int add (int val1, int val2); |
Using this declaration (via a #include <math.h> statement) the compiler knows enough to validate source code that invokes the method and can build the object code to call the method, but it doesn't have any implementation of the add method so it has an unresolved reference to 'add'.
The linker combines the output of the compiler with various library files (such as math.lib) to resolve these references and create an executable file, a program. There's no requirement that the .h and .lib file names match. In fact there's no need for there to be the same number of .h and .lib files.
That's only a broad outline though. Since the header file contains source statements you can do almost anything with a header file that you can do with any other C or C++ file. Header files can also be used to provide definitions for functions (and classes and structures) that you will be implementing in your own .c or .cpp files. Good coding practice suggests you separate declarations and definitions putting declarations in .h and the implementation in .c/.cpp files so the .h file can be used (included) in other .cpp files.
Some number of language standard header and lib files are included with the compiler itself. Most Microsoft Windows specific header and lib files are included in something called the Platform SDK. If you look back at the Visual C++ Express download page you'll see that step 4. is Install the Platform SDK. You probably want to do that if you haven't already.
One place to look is in the MSDN library (library in the sense of collection of books not library in the sense of a .lib file).
Right now there are two online versions of the MSDN, the msdn2 version is probably the better fit for Visual Studio Express. Remember though that this is the full MSDN and may include things that VC++ Express doesn't support.
http://msdn2.microsoft.com/default.aspxSome people find they prefer using Google to find these definitions. For example,to find the printf() description try the first hit in this search
http://www.google.com/search?hl=en&q=printf+site%3Amsdn2.microsoft.comThere is also MSDN Express Library 2005 included in the VC++ Express.
Finally, if you want a CD or DVD copy of the full MSDN you can buy an MSDN Library subscription (perhaps not a good fit with the free VC++ Express).
http://msdn.microsoft.com/vstudio/howtobuy/Default.aspx