Powermate-rb is a project mainly written in Ruby, it's free.
Ruby library for Griffin PowerMate.
This script refers to following Linux driver source. http://lxr.free-electrons.com/source/drivers/input/misc/powermate.c