The meaning and usage here is similar to "well, thank you", "well, yes", etc. It expresses a slight degree of surprise. The first example sentence you have given has become somewhat of a fixed expression in modern English (often used half-jokingly to express modesty, but also surprise at the compliment given). I don't hear the second very often.
I hope it helps.