This is not my code. It is just a copy of the code referenced here on Reddit with minor changes to make it compile on Windows. I copied an existing Pimoroni project to get all the build files and settings.
If you follow the Raspberry Pi Pico Getting Started PDF for Windows, then this should build by then following the Pimoroni instructions but replacing the last two steps with:
cmake -G "NMake Makefiles" ..
nmake