There is (was) a DBE Maths library that had all sorts of useful 2d to 3d vector operations including picking 3d objects with the mouse, line of sight collision detection, polygon collision and plane picking detection, among other things. The only link I know of to it has a version in Russian. It can be translated using Google Translate if need be - I was able to translate the DarEdit (the dbc library itself) file using the Opera Browser and setting the encoding to Cyrillic, copying the resulting text into google translate...
Here's the link:
DBEMaths
There has been a lot of discussion on the forums about this kind of thing. Search for posts like "pick object", "2d to 3d", "3d to 2d", "3d mouse" "mouse pick" .
The basic premise of projecting from the mouse is:
1. Finding a distance from the camera into 3d space where 1 screen pixel is equal to 1 3d unit. This distance is constant if the field of view and/or the camera window size doesn't change so usually only has to be calculated once.
2. Using that distance as a ratio to determine what 3d value the mouses 2d position is relative to
3. Offseting the mouse 3d calculation based on the camera rotation and the camera position.
4. Multiplying the adjusted mouse position by a desired forward projection distance.
Enjoy your day.