I don't fully cover contributions to cocos2d-iphone, only the concept. I think that would go too far here. If you are interested to learn this let me know.
You'll need to fork the cocos2d-iphone repository on github. Then you'll download this version and make your changes. When you're done with your changes, you can upload them with this command sequence:
git add .
git commit -a -m "describe what you have changed/added here"
git push
At that point your changes are still only for you, they are in github but only in your fork of cocos2d-iphone. To make the changes public you need to merge your fork back to cocos2d-iphone. Please consult Ricardo before doing so. At the minimum your change needs to be a bugfix for a reported bug, or an enhancement that a lot of people would appreciate. If that's not the case just keep the changes in your fork of cocos2d-iphone. That way you can update to the latest cocos2d-iphone without having to throw away your personal changes to the engine because git will help you merge your changes with any changes made to cocos2d-iphone.