Based on the sputtering version of the TRIM program for multicomponent targets, a Monte Carlo code has been developed which computes range profiles of implanted ions, composition profiles of the target and sputtering rates for a dynamically varying target composition. It takes into account compositional changes both due to the spatial distribution of target atoms deposited in collision cascades, and due to the presence of the implanted ions. The local density of the target is allowed to relax according to a given function of the densities of the individual components. The applications of the program cover a wide range of problems like the collisional atomic mixing of multilayered targets, dynamic implantation profiles at large fluences, and the fluence-dependent preferential sputtering of multicomponent materials. The present paper provides a description of the program and a critical comparison to similar Monte Carlo codes. As an application, the behaviour of the Ta-C system under He bombardment is studied with respect to sputtering yields, surface composition and composition profiles. Satisfactory agreement is obtained with experimental results given in the literature.