
This is a situation i always hope comes up, or deliberately try to set up! What you did was almost what I would have done, except after praising him once I had it an he was being good, I would then let him have it back, then let him know you were going to take it again. this time (having realised you could make him give it up) he would probably make less resistance, as soon as he accepted you had taken it away, lavish praise, repeat several times until he is no longer sulking, growling or objecting to you trying to take it. I then proceed to do the same excersise with my children (under vigilant supervision). for a very food y dog a treat offered in return for the ear is one non confrontational way of getting what you want (older pup oir adult, where there is bigger risk of actually being bitten). basically he will then learn that there is some compensation (food /you praise) for giving up the object, and also that you have the right to take it!
Treat this as a Golden opportunity, and with training you will then have a dog that you can happily take anything from.
I helped a friend with a food possesive golden retriever Adult, who would get nasty around really yimmy treats like a new bone. I started off with taking and giving treats for her giving up low value objects, gradully building up to a juicy meaty marrow bone!