Heh... wouldn't everyone.
check out Online Status as they provide a service (although you use their code).
I know that for AIM, it's as simple as opening a socket to big.oscar.aol.com/username and getting the response.
Now, here's a site that down in the comments gives a drawn out PHP example of getting user status'.
Yahoo! I don't think uses this, and neither does MSN. But onlinestatus.org has found a way to get it working.