Make sure to include
d3dx9.lib d3d9.lib dinput8.lib dsound.lib dxguid.lib winmm.lib

to your Linker->Input

