Controlling GPIO from a module

Hi all,

I would like to control the GPIO pins from my own module. Could someone give me an example on how to do this?