Note: this trick only works temporarily, i.e. while you're in the app. Even if you leave the app and run it in the background, when it's opened again it will be locked in its native orientation.
This also only useful for apps that allow both portrait and landscape orientations. Unfortunately, you can't force it to be in an orientation it wasn't designed for :(