That is easy:
Guid userId = SecurityUtility.GetUserId();
You might want to download the developer's reference guide
that lists all of the methods that can be used to build custom solutions. MonoSoftware.MonoX, MonoSoftware.MonoX.Utilities and MonoSoftware.MonoX.Repositories are nemaspaces you should get familiar with.
P.S. A new API with support for OpenSocial protocol is in the works. It will enable developers to build advanced mashups without using low-level calls.