Auto-rotation is a fairly simple concept to place into your app whether it be for the iPad or iPhone.
A few things to consider is what orientations are best for your app. The Apple reviewers have been known to reject apps that do not support appropriate rotation.
For the iPad, the rule of thumb is to support at least two orientations, and preferably all four.
If your app is designed for portrait viewing, make sure it supports regular portrait and portrait upside down.
For landscape apps, it should support both left and right views. Anything less will probably be rejected.
On the iPhone, your app should NOT be viewable in the portrait upside-down. On the iPhone this orientation will cause confusion should the phone ring.