Carbohydrates perform two main functions in the cell's membrane: <em>they participate in cell recognition and adhesion</em> (cell-cell signaling or cell-pathogen interactions), they also have a structural role as a physical barrier.
Most of the carbohydrates linked to the membrane are in the form of <em>glycoproteins oy glycolipids</em>, these are the molecules that share information and recognize host cells. <em>Glycocalyx </em>is another way we find carbohydrates in the cell membrane, this layer has cell-adhesion molecules that enable cells to adhere to each other.
I hope you find this information useful! Good luck!