The optimum design and management of residential photovoltaic (PV) communities are essential to the reliability to satisfy the demands of communities due to the volatility and intermittence of solar energy. The retailer for energy dispatch management is introduced to improve the economic performances of PV communities through demand-side management measures with the electric grid. This paper proposes a novel two-stage optimization model of design and electricity dispatch strategies for residential PV communities to operate electric vehicles' charges. The first-stage optimization aims to obtain the optimal capacities of PV and batteries. The second-stage optimization optimizes the retailer's hourly electricity prices and electricity dispatch strategies, in which the Stackelberg game is performed between maximizing the retailer's benefit and minimizing the electricity cost of residential basic loads and vehicle charging loads. A case study is implemented to validate the proposed model. The installation capacity of batteries is appropriately increased with the increasing active loads of electric vehicles. The optimal pricing strategies of the retailer based on the trade schemes with the electricity grid are influenced by their ratios of fixed and active loads. Compared to the community without the retailer, the annual electricity cost of users is saved by 21.2 % through the proposed management strategy.