Joint optimization of maintenance operations and spare parts inventory is promising for ensuring the reliable and efficient operation of industrial systems. Extensive studies have been conducted on joint optimization emphasizing various aspects. However, those studies still suffer two limitations. (1) The considered system structures are restricted to particular cases, and thus are unable to fully address the joint optimization needs of actual industrial systems possessing various structures, and (2) imperfect maintenance, as has been commonly adopted in industries, is not addressed in existing works, which compromises the economic efficiency of the joint policy. Targeted at these limitations, this paper investigates the joint optimization for multi-unit systems with a generalized structure, i.e., the systems consist of multiple identical units, and each unit possesses a complex subsystem structure. First, a total cost rate model is formulated, in which maintenance actions include both perfect replacement and imperfect maintenance, and the spare parts inventory policy consists of an (s, S) policy and the option to place emergency orders. Based on the formulated model, a simulation optimization method is proposed. The simulation module evaluates the total cost rate iteratively, and the optimization module utilizes a variable neighborhood search-based algorithm to obtain a high-quality joint policy with tractable computation times. Two numerical examples are provided for demonstration, and sensitivity analyses are conducted to study the effects of parameters.