Using
this type-library, you can use the official Messenger SDK. It's pretty limited though.
Here's outdated information about the SDK, please note that not close to all functions mentioned there is going to work (because Messenger dropped support for them a while ago). You can combine this SDK with the general Win32 SDK, to send messages for example,
here's an example.
By hooking Winsock (or creating some kind of proxy), you unofficially can read/intercept the Messenger session between the server and the client. Using this method, you can get a lot of events, but unfortunately all interception won't show inside Messenger (like modification of messages sent to your contacts). To do this, you would need to know the Messenger protocol,
here's unofficial documentation. The best way to hook winsock is to use API-hooking techniques to hook the send/recv functions (this is also what MsgPlus! does).
This article covers what you need to know to inject your own DLL into Messenger's address-space and apply hooks to its functions (with easy modifications, you can hook winsock).
Edit: The "add-in" API was a hidden feature in a WLM beta version. It was a very powerful SDK for the .NET platform, however they dropped support for it. These other APIs on that MSDN page aren't for Messenger, but for the Messenger service.