I describe composite pulses during which the average dipolar interactions within a spin ensemble are controlled while realizing a global rotation. The construction method used is based on the average Hamiltonian theory and rely on the geometrical properties of the spin-spin dipolar interaction only. I present several such composite pulses robust against standard experimental defects in NRM: static or radio-frequency field miscalibration, fields inhomogeneities. Numerical simulations show that the magic sandwich pulse sequence, a pulse sequence that reverse the average dipolar field while applied, is plagued by defects originating from its short initial and final pi/2 radio-frequency pulses. Using the magic composite pulses instead of pi/2 pulses improves the magic sandwich effect. A numerical test using a classical description of NMR allows to check the validity of the magic composite pulses and estimate their efficiency.