There are three parts to this project: the Emotiv software, the arduino software, and the processing software. The arduino code I used is found here on letsmakerobots. I used processing to then act as an interface between the arduino and the emotiv headset. My processing code can be found here. I believe there are still some bugs in my processing code, but you're more than welcome to use it. The EmoKey mapping that I used for the Emotiv Epoc can be downloaded here. Since I used the free Emotiv SDK, my EmoKey mapping is really busy with key commands being sent to processing, and my processing code is messy and lacks comments.
I will update this tutorial once I have more time to sit and write a detailed explanation. For the time being, feel free to download my code. I will also try to answer any questions as soon as I can.