Should be:
QUERY("r" << BSON("$gt" << startVal ) ).sort("r" << 1)
or even more simple:
QUERY("r" << GT << startVal ).sort("r")
limit
is expressed as part of the call to execute the query (3rd param)
auto_ptr<DBClientCursor> cursor = c.query("DB.coll", QueryHere, 1);