This paper proposes a formation generation algorithm and formation obstacle avoidance strategy for multiple unmanned surface vehicles (USVs). The proposed formation generation algorithm implements an approach combining a virtual structure and artificial potential field (VSAPF), which provides a high accuracy of formation shape keeping and flexibility of formation shape change. To solve the obstacle avoidance problem of the multi-USV system, an improved dynamic window approach is applied to the formation reference point, which considers the movement ability of the USV. By applying this method, the USV formation can avoid obstacles while maintaining its shape. The combination of the virtual structure and artificial potential field has the advantage of less calculations, so that it can ensure the real-time performance of the algorithm and convenience for deployment on an actual USV. Various simulation results for a group of USVs are provided to demonstrate the effectiveness of the proposed algorithms.