I suggest you have a look at what MobileRead and FeedBooks do in this area.
I know that there are some guides for Kindle that allow you to download your books directly from the device.
Look at the 3rd and 4th sticky on the Kindle content section :
https://www.mobileread.com/forums/forumdisplay.php?f=147
EDIT : oops, should have refreshed before posting.
Well, the link can be useful, I'm saved.