There are 3 things that you need to do:
i Download and install Dev C++
ii Download glut (OpenGL) and install into Dev Cpp
iii Create a project to run a suitable.cpp program
Steps i and ii can be combined by downloading Dev C++ with OpenGL already installed from http://staff.bath.ac.uk/abscjkw/ComputerPrograms/DevCpp/Dev-Cpp.zip.
To try out step iii, download the program OpenGLSpheresPC.cpp and the project OpenGLSpheres.dev into the same folder. Double click the project to open it and then go to Execute-> Compile & Run.
Dev C++ can be downloaded from www.bloodshed.net.
To use Open GL install the correct version of glut DevPack go to http://www.nigels.com/glt/devpak.
Download glut.3.7.6+.DevPak to a local folder
In Dev C++ open the package manager:
Tools->Package Manager
Install the glut package:
Package->Install Package
Browse to the local location where the package was downloaded to follow the installation wizard
The glut package should now appear in the main pane
Exit package manager
To compile, build and run using Dev C++: make a new project:
File->New->Project...
Select Empty Project type from the Basic tab window
Make sure C++ project is selected
Create the new project in the folder with the source file
Add the .cpp file to the project:
Project->add to project
select the .cpp file
Define the linker options:
Project->Project options
In the Parameters tab window add the following line in the Linker pane:
-lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32
click ok
Compile and run the project:
Execute->Compile & run