Design strategies to assemble dissipative building blocks are essential to create novel and smart materials and machines. We recently demonstrated the hierarchical self-assembly of phoretic microswimmers into self-spinning microgears and their synchronization by diffusiophoretic interactions [Aubret et al., Nature Physics, 2018]. In this paper, we adopt a pedagogical approach and expose our strategy to control self-assembly and build machines using phoretic phenomena. We notably introduce Highly Inclined Laminated Optical sheets microscopy (HILO) to image and quantify anisotropic and dynamic diffusiophoretic interactions, which could not be observed by standard fluorescence microscopy. The dynamics of a (haematite) photocalytic material immersed in (hydrogen peroxide) fuel under various illumination patterns is first described and quantitatively rationalized by a model of diffusiophoresis, the migration of a colloidal particle in a concentration gradient. It is further exploited to design phototactic microswimmers, that direct towards the high intensity of light, as a result of the the torque exerted by the haematite in a light gradient on a microswimmer. We finally demonstrate the assembly of self-spinning microgears from colloidal microswimmers by controlling dissipative diffusiophoretic interactions, that we characterize using HILO and quantitatively compare to analytical and numerical predictions. Because the approach described hereby is generic, this works paves the way for the rational design of machines by controlling phoretic phenomena.