You can use several types of mates in SolidWorks to do this, depending on what effect you want. Here are some examples, although I'm sure I've left some out :)
Tangent faces will bring the two faces so that they touch.
With a tangent mate, the two parts are free to be rotated around one another. Other mates can be used to keep them fixed at a certain position (parallel or coincident planes, end faces, axes, etc.
Gear Mates (Under Mechanical Mates) can be used so that the two faces rotate relative to one another.
As shown here, the parts rotate oppositely when one or the other is rotated, as if they were connected by gear teeth.
Gear ratios can be set so that the rotations are set at a certain ratio to one another.
Screw mates can be used if the two faces are desired to be concentric.
With screw mates, the two parts will rotate together.
Universal Joint mates are used when two circular faces are neither tangent nor concentric.
The parts will rotate relative to one another as if connected by a universal joint.