Make a hole in the center of one of the Styrofoam cups, and glue the Styrofoam disk to its bottom. place your dowel through both holes and glue it in place. You can also make a small (1") foam disk, and place it at the bottom of the cup, but this is not really necessary.
Make a smooth blob of glue around the dowel at the back of the cup. this will serve as a pivot for the second cup, which must be left free to wobble on its axis. You can also cut several 1/2" diameter Styrofoam disks and place them over the dowel instead.