See: https://www.ethereum.org/token
Look up ERC 20 - it's the standard token contract spec. Should be easy to understand if you program other languages.
Also, I wrote a Solidity tutorial (pull requests welcome as the language has changed a bit since I wrote it):