Here is a source code I found while searching google for API functions. The source will generate a header file from a source file, anyways reading it you can learn a lot.
http://www.hwaci.com/sw/mkhdr/makeheaders.c
I also know you can generate header files from a compiled .dll file. Sounds interesting but seems mostly undocumented.