I and a friend of mine pour out as much of the LME as we can easily, then carefully did it into the boiling wort. Put the cap back on and shake it really good. Careful is the word here, it is hot... But you get each last drop of goodness.
For the DME, I pour the bag as quickly as I can and if there is a bunch stuck, I again stick the bag down in the wort. I am not that worried about cleanliness at that point, heck I am going to boil it for an hour.