hi guys i need your help

i got a simple problem...
i got a 3d model displayed...
now want i want is, clicking on the model with the mouse and getting the coordinates of the nearest vertex to the mouse pointer.

in other words i need a selection-vertex function which is included in every 3d modelling pogramm.

i know i have to caculate from 2d mouse coords to 3d model coords.. but i dont know how?!?!

have you got any tutorials on this ??
or can you write me the basics?

p.s. i cannot use any glut functions only opengl!
glut is not allowed in my c++ code (dont ask why )