Second-quantization representation and diagrammatic technique for systems of composite particles