Background to King Charles II's last words
Charles did indeed have many mistresses and, whilst leaving no legitimate heir, he did make many of his illegitimate children dukes. The dukedoms of Cleveland, Buccleuch and Queensbury, Monmouth, Richmond and Gordon, Grafton and St Albans all stem from these affairs.
On his deathbed, he asked his brother to look after his mistresses, including the aforementioned Nell.
Sadly, and like many of the most quotable 'last words', Charles' "Let not poor Nelly starve" wasn't actually the last thing he said. His actual dying words, during a lingering demise caused by kidney failure, were:
"You must pardon me, gentlemen, for being a most unconscionable time a-dying".
See also: the last words of Oliver Cromwell.