The IK Solver constraint now supports a pole target to control the roll of the IK chain. A typical example where this would be used is a leg, with the IK target being the foot, and the IK pole target controlling the direction of the knee. An offset for this roll can be set with the "Pole Offset" button.
Example .blend file.