well that's not really easy, there are several chunks in the header, and the number of these chunks also may vary from file to file. Then you have to get the wave data length, the sample rate, the bit rate and the number of channels...
I've built a small sample prog, that uses a c++ library (easier to code that difficult stuff imho), which offers such a function :
http://www.matthias-auer.net/Projects/WaveFileSize/WaveFileSize.zipin that zip, there is a lite-c script, the dll (plus it's source (visual studio 2010)) and a small wave file
i only tested the dll with some samples, but it should work, if the dll isn't able to open the file or something it returns -2 or -1 !