Its a bit complicated, but when I first started playing with iptables, I used this document
http://iptables-tutorial.frozentux.n...-tutorial.html
When setting up your firewall I wouldn't worry too much about limiting outbound connections (at least for now, you can also play with restricting outbound traffic later.) Instead, decide what types of inbound traffic you need to allow (i.e. what services do you want your machine to provide to others) and go from there.
This is what I like to start with for a basic firewall on a desktop machine
1. Allow all inbound and outbound traffic on the loopback interface
2. Allow all outbound connections and related connections (i.e. you want to allow incoming traffic realted to outbound connections you've established)
3. DROP all other inbound connections
I would start with something like this, test it, and tweak it as needed
If I can be of any help, please let me know.