We introduce a new, publicly available Monte Carlo radiative transfer code, Stokes, which has been developed to model polarization induced by scattering of free electrons and dust grains. It can be used in a wide range of astrophysical applications. Here, we apply it to model the polarization produced by the equatorial obscuring and scattering tori assumed to exist in active galactic nuclei (AGNs). We present optical/UV modeling of dusty tori with a curved inner shape and for two different dust types. The polarization spectra enable us to clearly distinguish between the two dust compositions. The Stokes code and its documentation can be freely downloaded from http://www.stokes-program.info/.