Certainly more is known about Anne Shirley from Anne of Green Gables than Cosette from Les Miserables as one character is the heroine of her novel while the other takes a less important role.
There are several differences between these two characters. Not much is known about Anne's childhood before the Cuthberts, but it is assumed that she was healthy and taken care of. Cosette, we know, was abused, neglected, and literally saved by Jean Valjean.
Once in his care, Cosette is rather spoiled. She receives nice clothing, a formal education in a convent, and all the patience and love of a man who is willing to do anything for her. It could be argued that she is rather sheltered and though she has always had everything she needs, it seems she's managed to remain somewhat humble. The novel only shows Cosette as a victim who gets a second chance. She is not portrayed as having a spoiled nor selfish attitude. She comes across as modest, shy, and grateful.
Anne Shirley might be quite the opposite of Cosette. She is brash, opinionated, outspoken, and unrefined. Her "formal" education comes from a country school and the life lessons of two much older "parents" who try to teach her by experience. What she lacks in manners appropriate to her social position (which is much more poor than Cosette), she more than makes up for in honesty and humor. Anne comes across as far progressed for her society, both as a character and as a woman. She too is likely grateful for the life she has with the Cuthberts, but her story focuses less on her thanks and more on her trials by error and learning as a result.
I imagine if Anne Shirley and Cosette were friends, Anne would do most of the talking, and Cosette would mostly giggle and blush.