I am currently tryin
It looks like you want a real solution, not just reimplementing PING for the sake of it.
I recommend using IP helper (ICMP.dll on pre-WinXP systems), specifically, IcmpSendEcho (or its enhanced versions, IcmpSendEcho2, IcmpSendEcho2Ex, for asynchronous operations).
There is a complete example of "pinging" a host on MSDN. It may be a good starting point.
Update: for GCC (mingw), link with -liphlpapi.