Mechanically, the Companion Cube is just a regular weighted storage cube with a heart painted on its side. Functionally, it behaves like any other cube you'd use to hold down buttons or block hazards.
Where it gets interesting is the story. In one test chamber, GLaDOS hands you the cube as part of an experiment to see how you, the test subject, handle loss. She then asks you to euthanize it, locking the elevator until you drop the cube into a pit she calls the "Aperture Science Emergency Intelligence Incinerator."
Afterward, GLaDOS keeps needling you about having "killed" it, with lines like throwing a party for you that all your friends were invited to, except you have no friends because you killed them. Annoyed, Chell ends up tearing the little robot apart and tossing the pieces into the burner.