Howdy.
I did something like this a while back. The source is longish and it's midnight here - I'm too tired to compile a list of the steps needed to free yourself from GLUT - or more importantly, draw with openGL into your own window.
You may wish to look over the files in this zip:
Drawing with openGL without using glut[
^]
The following things are worth noting:
1) the HDC is a global since it is used when setting up the window ready for GL, it's also used in the call to SwapBuffers within DrawGLSLScene
2) phong.frag and phong.vert need to be in the same folder as the exe file
3) EnableOpenGL is the function that tells openGL where to do it's drawing
4) It's a Code::Blocks project (haven't tried it with VS yet - dunno if it would compile)
5) I never imagined I'd share it, it was done simply to put a openGL scene on a dialog complete with controls to manipulate the cube - sliders for rotation and check-boxes to toggle both (a) lights and (b) shaders
EDIT:
6) The floor is always drawn using a shader - regardless of the state of the check-box
Cheers,
S.