Assuming you know that the target is a Windows system, I would use WMI (the Windows CIM implementation) to accomplish this. Here is the same question answered for VB.Net, which is easy enough to translate to VC or C#. As the link says, be sure to import the System.Management and System.Management.Instrumentation namespaces.
Dim theManagementScope as new ManagementScope("\\" & ComputerName & "\root\cimv2")
Dim theQueryString as new string = "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 1"
Dim theObjectQuery as new ObjectQuery(theQueryString)
Dim theSearcher as new ManagementObjectSearcher(theManagementScope, theObjectQuery)
Dim theResultsCollection as ManagementObjectCollection = theSearcher.Get()
for each currentResult as ManagementObject in theResultsCollection
It may also be possible to get the information from the DHCP server with DhcpEnumSubnetClients, DhcpEnumSubnetClientsV4 or DhcpEnumSubnetClientsV5. Not sure what kind of permissions you need to run that or if it has to be run from the DHCP server, though. Docs aren't very clear.