Here is a sample that has implementation for IComparer and ICategorizer and changing the caption text in QueryCellStyleInfo.
This sample groups the rows into groups based on ranges of values. For instance, one set of rows will have values in the range 1-10, another in the range 11-25.