Given its IP, how can I find out the name of a Windows PC on my network?
If you're using Lion, you can use smbutil:

usage: smbutil [-hv] subcommand [args]
where subcommands are:
 help       display help on specified subcommand
 lookup     resolve NetBIOS name to IP address
 status     resolve IP address or DNS name to NetBIOS names
 view       list resources on specified host
 dfs        list DFS referrals
 identity   identity of the user as known by the specified host


For example (assuming 192.168.1.9 is a valid IP on your network):

smbutil status 192.168.1.9
smbutil lookup bill-pc


If you're using Snow Leopard, you should be able to use nmblookup:

nmblookup -A 192.168.1.9
nmblookup bill-pc