The program triangle.c is perhaps the simplest example of a program using OpenGL and GLUT. It draws a triangle and then waits until you type 'q' to quit. A more involved and interactive version (by Kobus Barnard) can be found here.