In complex systems such as a flock of birds or a school of fish, we observe at large scales the formation of complex structures. To model these phenomena, we can either use "microscopic models" describing the motion of each individual or "macroscopic models" (PDEs) describing the evolution of the density of individuals. In this talk, we discuss how we can "link" the two approaches using kinetic theory. One of the main difficulty to study those systems is the lack of conserved quantities (e.g. momentum, energy). To overcome this difficulty, we introduce of new type of "collisional invariant" that allows us to derive the macroscopic limit of a large class of "microscopic models". Based on this method, we develop accurate numerical schemes for both kinetic and macroscopic models. We observe numerically new types of solutions that remain to be understood analytically.