This tutorial will guide through the steps to create a simple custom layer for Caffe using python. By the end of it, there are some examples of custom layers.
Usually you would create a custom layer to implement a funcionality that isn't available in Caffe, tuning it for your requirements.
Probably just Python and Caffe installed.