You can do it with drawing lines (glBegin(GL_LINES)) . You should do it after drawing all other scene data. And also make sure that your scene transformations will not effect the axis drawing.
it will be like this
DrawScene() // All scene drawing goes here.
glTranslatef( adjust the coordinates such that axis are at correct position)
DrawAxis() // draw axis will use lines.
This will work. One more thing , don't mix up Opengl with GDI.
if you still want to modifu frame buffer use glDrawPixels
Hopes this helps