Blktap-ko is a project mainly written in C, it's free.
Blktap kernel module
The kernel module for blktap2
To compile:
make -C /lib/modules/uname -r/build M=$PWD
uname -r
Tested on debian sid, with linux-image-3.0.0-rc3-686-pae