As said here, it's the cache of all training samples, ie: you need an initial set. After that, you could request for all new vectors which are the closest in the training set. kNN is a classifier (that's why it inherits from CvStatModel. A typical used is: you have a training set of features computed from what you want, says ORB features from a dataset of images (but not limited to keypoints!) and you want to know for an unknown image, what is it. You train your kNN with the training set (ie: the features computed on each images you know the class), you compute the features on your unknown image, and you find the k nearest neighbors in the training set (with find_nearest). You look at the label of each of the nearest neighbors, and the majority label is probably the class for your image => you have recognize and image. This is just a typical used of kNN and there is many others!
If you are looking for a solution to cluster a group of data into K class (ie: for a set of vector, you want to make a partition into k groups), look at kmeans.
You are right, the documentation (http://docs.opencv.org/modules/ml/doc/k_nearest_neighbors.html) is missing the first three parameters.
That is your features.use c++ & pass Mat instead of CvMat*
Like @Mostafa Sataki mentioned, the second 'C++' directive is actually just a C++ wrap around the original C - style API, which requires these crazy structures like CvMat pointers. Like him I suggest taking the first C++ directive: