How can I check the status of transactional replication? How can I check if there are commands waiting for being executed in the subscribers and find if there is any error occurring in my publication.

I want to be able to do this programmatically so the replication monitors is not an option.

The objective is to give some feedback to a C# program, so that the program can adapt his behaviour, depending on the possible problems.
The application to do this with is the replication monitor.  To use it log into SQL Server Management Studio and connect to the publisher.  Right click on Replication in the tree and select Launch Replication Monitor (it might not be labeled exactly that).  Connect that to the distributor and you can see the replication status.

This app uses a funky set of custom queries as well as some stored procedures to figure out what's going on.  If you needed to see what's going on you'll want to run SQL profiler against the distributor so you can see how the data is flowing.  That way you can see all the commands that the replication monitor is using.