OpenNMS features layer2 discovery through SNMP collection (as I'm sure do other similar tools).
OpenNMS will pull in MAC, VLAN and STP information from managed devices, and use this to build up a l2 topology, which it can then map. (Native mapping currently only works for IE, but the next stable release - 1.8 - I think will have better mapping support). You can see which nodes are connected to a given node on a per-port basis.
Alternatively, if you're comfortable writing something yourself, snimpy provides an excellent programmatic interface to SNMP, bypassing a lot of the overhead of programming for SNMP. I've used it recently to generate a live summary of vlans per port, something our switches didn't report cleanly.