As far as I know right we had full raw socket support in windows beginning with win2000 and ending with WinXP SP1. From WinXP SP2 only raw UDP sockets are available and even raw UDP sockets have some extra restrictions. More about these limitations here:
http://msdn.microsoft.com/en-us/library/ms740548%28v=vs.85%29.aspx[
^].
You can use the winpcap driver to have better raw socket support, even with TCP:
http://www.winpcap.org/default.htm[
^].
I'm not going to write a novel about winpcap here, check out its documentation. If you need total freedom on windows use this. Another benefit of winpcap is that its compatible with libpcap (its unix sibling) on source level so you can write platform independent network tools using it. Winpcap is utilized by my favorite packet sniffer: WireShark.
Now you have the essential info and the keywords to search for code examples using google. For example using the "winpcap raw udp packet tutorial" keywords with google I found this:
How to craft UDP packets and send them with WinPCap[
^]