It's just another way of saying 'very well', which is still used by educated people (in the UK), usually as a response. You'd usually hear 'very good' or 'very well' in certain circumstances - perhaps there's been a discussion or argument about whether doing something is a good idea or not, and the person who originally argued it wasn't changes their mind and then agrees to comply by saying 'very well' or 'very good'. In practice, only 'very well' has survived, it's rare to hear very good in any other sense than the modern one which you quote in your question. An older relative of mine, when his wife announced she was going shopping or whatever, would respond with 'very well'. I heard 'very well' recently - it was, this time, following an argument, and the father eventually, once agreement between the two parties had been reached, said 'very well then, that's what we'll do', but he could have said 'very good, then that's what we'll do' and its meaning would be the same, which is more or less'so be it'.
UPDATE FOLLOWING COMMENT: I can't see why it's difficult to work out the origin - as a phrase, it doesn't have an origination, it's the component parts, that is 'very' and 'good'. Since 'good' and 'well' were once synonymous (but not necessarily in modern usage), 'very good' is the same as saying 'very well' in these circumstances. In the UK, when asked how we're feeling, we may answer 'very good' or 'very well', so even now, the use of 'good' and 'well' can be interchangeable. Either way, 'very good sir' still means 'I comply' or 'so be it', as it always has.