Although the Oculus Rift SDK isn’t itself free software, there are already a number of projects that use or replace it that are.
Three.js includes an Oculus Rift demo:
https://github.com/mrdoob/three.js
https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometry_minecraft_oculusrift.html
There’s a class for using the Rift with the polular Ogre 3D environment:
https://bitbucket.org/rajetic/ogreoculus
EOS3 is a virtual desktop environment:
https://bitbucket.org/macBdog/eos3/
And so is Ibex:
Vireo Perception is a Direct X ( :-/ ) hooking stereo driver:
https://github.com/cybereality/Perception
And in fact there’s lots of good stuff on Github generally (search for “Oculus Rift”):