The TPM is not intended to be programmable. It has a fixed set of supported algorithms. The code is stored in ROM (or if it isn't, it is stored in an EEPROM that is inside a somewhat tamper-proof package and you don't get to overwrite it).
The TPM defines various administrative roles. When you first use it, you'll set up administrative passwords (or your software will do it for you, in which case you should carefully back up these passwords). If you are unsure about the state of the TPM when you receive it, you can reset it to “factory defaults” (clearing all existing keys and credentials); this is called clearing the TPM and is normally done from the BIOS.
You'll find an overview of the various credentials stored and used by the TPM in the credential profiles. In addition to the keys that are part of the normal lifecycle, you can import your own keys and create non-exportable keys with the TPM's RNG.
There is a standard TPM protection profile. I don't know if Intel's TPM has been evaluated with respect to it. Figure 1 is a diagram of the TPM lifecycle, which shows when keys can be generated.
In practice, you'll probably interact with the TPM through TrouSerS (a fully open source TPM API), or in a limited fashion through Bitlocker on Windows.