Lagrangian dynamics of a classical spinning particle with dipole moments