I think you just need to execute vcvars32.bat, which is usually located in the same folder that houses 'cl.exe'. That sets up some environment variables that enables 'sys/types.h' (and other needed files) to be found.
want to be accessing PerlCRT.dll and PerlCRT.lib (which would best be removed from perl's core folder).
Fwiw, I found that using Inline::C (which autogenerates the XS file for you) was the best introduction to writing perl extensions.