We perform coarse-grained computer simulations of solutions of semidilute wormlike micelles and study their dynamic and rheological properties, both in equilibrium and under shear flow. The simulation model is tailored to the study of relatively large time and length scales (micrometers and several milliseconds), while it still retains the specific mechanical properties of the individual wormlike micelles. The majority of the mechanical properties (persistence length, diameter, and elastic modulus of a single worm) is determined from more detailed atomistic molecular dynamics simulations, providing the link with the chemistry of the surfactants. The method is applied to the case of a solution containing 8% (by weight) erucyl bis(hydroxymeth...