I managed to solve this issue in the end. It turns out you can only install hardware providers on windows server distributions, I was using ordinary Windows 7. See the MSDN page for the API call:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa381923(v=vs.85).aspx
Compiling for 64 bit and using the 64 bit tools with the SDK on a windows server 2012 machine it seems to work correctly.