The C-Gear allows you to trade or battle with your friends using IR (infrared) or wireless communications. It also allows you to access the Dream World. Like Mew said, you get it "after you defeat the Plasma Grunts terrorizing Munna"
You get a C-Gear from Fennel after you defeat the Plasma Grunts terrorizing Munna.
In the Dreamyard near the first gym you will find some Team Plasma grunts terrorizing a Munna for it's Dream mist.Defeat the grunts and then Professor Fennel will come where you battled the Plasma grunts.She will pick the item ball which Munna left and tell you to visit her in her lab.You must go to the lab and converse with her.She shall give you the C-Gear.