If your PC and your phone have WIFI and its connected, you can just use sockets and broadcast over UDP to discover IP addresses.
This doesn't require any special libraries or code.
Now if you are trying to force the PC and phone to connect to a certain AP, then you would need to use the special libraries that are OS specific and change between versions of windows.
Typically only the admin/root user can muck with WIFI programatically.
But once connected to the same WIFI AP on the phone and PC (or maybe even adhoc) you have a fully working ethernet/wifi IP connection and you just discover the addresses using UDP broadcasts, and then you can send and recv data using any socket or socket-like way.
After reading....
http://msdn.microsoft.com/en-us/library/windows/hardware/hh440285(v=vs.85).aspx
A Wi-Fi Direct Device on the PC is not discoverable by default. Before it becomes discoverable, Windows will configure the P2P Device Info on the port and provide the set of IEs to include in the probe response. The Device port should only make itself discoverable once Windows has enabled Listen State on the port.
The Wi-Fi Direct device port is requested to perform Device Discovery with theOID_DOT11_WFD_DISCOVER_REQUEST. The miniport driver follows the guidelines in the Wi-Fi Peer-To-Peer Technical Specification for performing device discovery. It reports the completion of the discovery process using NDIS_STATUS_DOT11_WFD_DISCOVER_COMPLETE. The miniport driver must report the list of discovered devices in this completion indication. This completion behavior is different than scanning in Extensible Station Mode.
WIFI-Direct is not going to work right out of the box for security reasons.