As luke noted, the code to create and bind the context is specific to each windowing platform.
Here are some functions to get you started in terms of initializing OpenGL on specific platforms:
Windows (a tutorial is here)
- wglCreateContext(hDC)
Mac OS X — OS X has essentially three options: Carbon, Cocoa, and the underlying Core Graphics Layer
- The entire guide for Mac OS X OpenGL development
- Carbon: aglCreateContext
- Cocoa: Create (or subclass) an NSOpenGLView. They create their own context, and you can read their method documentation to find how to make it current.
- CoreGraphicsLayer: CGLCreateContext
Linux
- glx: glXCreateContext