Writing your first Erlang driver can be very difficult as there are very limited examples and the documentation can be very obscure. In this article, I will walk you through writing one for a common purpose-- writing to a database.
http://dawsdesign.com/drupal/erlang-driver-walkthrough