The muscular fibers (or more exactly the actin and myosin filaments) are contracted towards each other. This makes them "move to the middle" and you build up a force on both sides of the muscle. See this image (from the Wikipedia), which illustrates this process:
!enter image description here
There is also an animated picture available, which illustrates this process even better (from here):
!enter image description here
The process of the contraction applies a equal force to both endpoints of the muscle.