First-principles modeling of systems with localized d states is currently a great challenge in condensedmatter physics. Density-functional theory in the standard local-density approximation ͑LDA͒ proves to be problematic. This can be partly overcome by including local Hubbard U corrections ͑LDA+ U͒ but itinerant states are still treated on the LDA level. Many-body perturbation theory in the GW approach offers both a quasiparticle perspective ͑appropriate for itinerant states͒ and an exact treatment of exchange ͑appropriate for localized states͒, and is therefore promising for these systems. LDA+ U has previously been viewed as an approximate GW scheme. We present here a derivation that is simpler and more general, starting from the static Coulomb-hole and screened exchange approximation to the GW self-energy. Following our previous work for f-electron systems ͓H. Jiang, R. I. Gomez-Abal, P. Rinke, and M. Scheffler, Phys. Rev. Lett. 102, 126403 ͑2009͔͒ we conduct a systematic investigation of the GW method based on LDA+ U͑GW @LDA+U͒, as implemented in our recently developed all-electron GW code FHI-gap ͑Green's function with augmented plane waves͒ for a series of prototypical d-electron systems: ͑1͒ ScN with empty d states, ͑2͒ ZnS with semicore d states, and ͑3͒ late transition-metal oxides ͑MnO, FeO, CoO, and NiO͒ with partially occupied d states. We show that for ZnS and ScN, the GW band gaps only weakly depend on U but for the other transition-metal oxides the dependence on U is as strong as in LDA+ U. These different trends can be understood in terms of changes in the hybridization and screening. Our work demonstrates that GW @LDA+U with "physical" values of U provides a balanced and accurate description of both localized and itinerant states.