The issue is because the value of _WIN32_WINNT is below 0x0501. When I compile in Code::Blocks I get the same problem, but if I compile in Visual Studio C++ then I no longer have the problem. This is because the version of MinGW that comes with Code::Blocks is giving _WIN32_WINNT me a value of 0x0400 whereas Visual Studio is giving me 0x0601.
The solution to this is to manually define WINVER and _WIN32_WINNT to 0x0601, install the latest version of MinGW (manually, because I tried the automatic installer and it didn't seem to do anything) or convert to the darkside and use Visual Studio.
If you are going to do some game development (I am assuming you are because you are playing around with DirectX) I would suggest using Visual Studio because I have ran into many problems trying to get stuff working with MinGW (NVIDIA PhysX SDK couldn't find lots of stuff).