This can be done with some degree of effort using the Bitcoin API.
v0.7 getrawtransaction gives you access to transactions even those not in your wallet.
There are other tools that you can use to build this capability as well.
- libBitcoin
- Armory (see Extras)
- Bitcoin ABE
- BitsOfProof supernode [pre-release]