How do that charge gets transferred while rubbing? We all have studied that on rubbing a glass rod with silk or human hair, the two get charged with opposite polarities.
What confuses me is that since both glass and silk(or hair) are insulators, they contain no free electrons. So, how do the electrons get transferred?
 A: This is the triboelectric effect.  One microscopic explanation is that when you rub two insulating materials the different atoms get close enough that it is energetically favourable for them to exchange electrons.  Then when you pull them apart the electrons stay put and the objects both have a net charge (one positive, one negative).  The Wikipedia article on the effect has more, and an excellent photo of the effect in action.  This is, incidentally, why van de Graaf generators work.
A: Whenever insulators are rubbed the microscopic irregularities on their surface rub against each other which causes transfer of negative charges between the materials. Which of the two materials will end up being positive ( or negative) depends upon their relative position in the triboelectric series.
Well, not being a conductor has nothing to do with the material's ability to share charges while rubbing. 
Obviously, after getting charged the net charge isn't distributed across the entire surface of the insulator like in a metal. The charge gained is localized because as you mention insulators don't have free charge carriers.
A: Well, in the case of insulators: while the electrons in the material are not free enough to support conduction of electric current it's not the case that those electrons are absolutely bound. 
The wikipedia about triboelectric effect that is already linked to in an earlier answer describes a tribolectric series. For best results one should use a pair of materials that is far apart in the triboelectric series. (Conversely, if the two are very close there may not be any transfer of charge.) So there is a scale, and from material to material the probability of losing an electron or acquiring an eletron is different.
About electrostatic force
The electrostatic force is very, very strong. Even transferring a small quantity of electrons is sufficient to give a very noticable electrostatic charge.
One way to illustrate just how strong the electrostatic force is is to look at Millikan's famous experiment to determine the charge of single electrons. The oil droplets in this 1909 experiment were not too small to be observed, and from the observations the experimenters could infer that some droplets had a single extra electron, or two extra, or other multiples, and these could be distinguished from each other obvervationally such that the charge of a single electron could be determined.
The probability of transfer of electrons when rubbing is very low, but not zero. Transfer of a relatively small amount of electrons is sufficient to give a noticable electrostatic charge.
More generally: there very few processes that have a zero probability of occurring (arguably there is no such process at all). It's just that in many cases the probability is negligably small.
But the electriostatic force is so strong that there is a noticable effect.
