This could be easy or significantly time consuming based on whether you are writing an enterprise application or something just for your use.
There are monitoring solutions available like SCOM which can discover and collect information from various machines.
If you are writing your own app then you should think of certain things:
1. Authentication
2. Communication (agentless or agent based and, protocol WMI/Powershell/etc.)
For a small application, I'd suggest using remote powershell. The following link has a powershell script for getting logged on user information from machine.
https://gallery.technet.microsoft.com/scriptcenter/d46b1f3b-36a4-4a56-951b-e37815a2df0c[
^]