I'm not sure if you're going to use a "real" camera and pictures or 3D renderings, but for rendering you should:
- render each side on a square texture
- set X and Y fov to 90deg.
- point the camera exactly along each axis: +X,-X,+Y,-Y,+Z,-Z
This way you should get 6 pictures that work quite well together.
If you want to do this for a "real" pictures, then you'll need some mapping from your distorted images to a cube map. This will depend on your lens, so it's not so easy; I think that professional apps for this task do this by comparing pictures, rather than just math.