Here on the API Development Team Blog is a quick C# (should be easy to convert to c++) program which connects to SQL Server and shows the text of all starting batches in real time as the requests are coming to SQL Server.
e.g. Code snippet from link
Console.WriteLine("Event : " + trace["EventClass"]);
Console.WriteLine("SPID : " + trace["SPID"]);
Console.WriteLine("Login : " + trace["SessionLoginName"]);
Console.WriteLine("Object: " + trace["ObjectName"]);
Console.WriteLine("Text : " + trace["TextData"]);
As Alex mentioned, you will need to use the TraceServer API.