in this case you have at least two options for modifying the traffic and various ways to do this in practice.
the first and most obvious method is the hooking of the send or recv API of Windows which can be made though the loading of the dll (containing all the needed code for modifying the import table and doing what you want) inside the process of the application that you want to control.
at the moment I don't have a simple example for doing this (probably microsoft detour could do the job easily).
the other alternative is through the dll proxy where the process is not touched: application -> proxy_ws2_32.dll -> real_ws2_32.dll
an example of this method is my proxocket project where it allows also to modify the traffic through the writing of a simple dll plugin:
http://aluigi.org/mytoolz.htm#proxocketanother option is creating a datapipe (the target host is fixed) or a minimalistic socks proxy with your code inside it for modifying the traffic of the proxyfied application.
I don't know exactly what you need to do and what part of the traffic you want to modify (incoming or outgoing or both) and so what solution can be better in your case.
in my opinion the dll plugin for proxocket is a good idea.