Autonomous driving and intelligent transportation applications have dramatically increased the demand for highaccuracy and low-latency localization services. While cellular networks are potentially capable of target detection and localization, achieving accurate and reliable positioning faces critical challenges. Particularly, the relatively small radar cross sections (RCS) of moving targets and the high complexity for measurement association give rise to weak echo signals and discrepancies in the measurements. To tackle this issue, we propose a novel approach for multi-target localization by leveraging the controllable signal reflection capabilities of intelligent reflecting surfaces (IRSs). Specifically, IRSs are strategically mounted on the targets (e.g., vehicles and robots), enabling effective association of multiple measurements and facilitating the localization process. We aim to minimize the maximum Cramér-Rao lower bound (CRLB) of targets by jointly optimizing the target association, the IRS phase shifts, and the dwell time. However, solving this CRLB optimization problem is non-trivial due to the non-convex objective function and closely coupled variables. For single-target localization, a simplified closed-form expression is presented for the case where base stations (BSs) can be deployed flexibly, and the optimal BS location is derived to provide a lower performance bound of the original problem. Then, we prove that the transformed problem is a monotonic optimization, which can be optimally solved by the Polyblock-based algorithm. Moreover, based on derived insights for the single-target case, we propose a heuristic algorithm to optimize the target association and time allocation for the multi-target case. Furthermore, we provide useful guidance for the practical implementation of the proposed localization scheme by theoretically analyzing the relationship between time slots, BSs, and targets. Simulation results verify that deploying IRS on vehicles and effective phase shift design can effectively improve the resolution ability of multi-vehicle positioning and reduce the requirements of the number of BSs.