sorry for the bad rep.
But, recently i've obtained a code in c++ which highlights c# syntax in a Richtextbox. LINK
I think the basic idea behind it is to specify an array of strings, and now the program should search and highlight the defined strings in a file.
Then you can use that to colour your code however you wish! I'm not sure if the source code is released or how much effort is required to port that to c++. It seems like it's only available for use with php and html.
I reckon if you want to this this yourself, and build an accurate syntax highlighter, you'll have to use regular expressions, especially for multiple nesting within comments and quotes.