A metaphor is a strong comparison between two things, saying not that one thing is "like" the other (a simile), but instead that the one thing "is" the other. Check the link below for the eNotes definition for metaphor in the Guide to Literary Terms. Part of that definition says, "It is an implied analogy or unstated comparison which imaginatively identifies one thing with another."
In "My Last Duchess," there is more of an idealogical metaphor happening, rather than a comparison between two objects or people. The Duke, who is discussing his former wife with the man who has been sent to negotiate with him concerning his next wife, talks about the painting of his duchess almost as if the painting itself were really his wife. He mentions how she "stands" there, almost as if she were still alive. And as the poem progresses, we discover that he prefers it that way - he prefers his wife to be more of an object that can hang on the wall and look pretty, rather than a real flesh and blood person who smiles at other people.
Also, be sure to check the link below concerning themes of the poem. One theme that is discussed is the relation between art and experience, which is very metaphorical with regards to this poem. The Duke collects art and people for their beauty, and his priorities are so out of whack that he seems to confuse the two, and will even destroy someone if they are not just part of his elaborate collection.
There she stands
As if alive. Will't please you rise? We'll meet
The company below, then. I repeat,
The Count your master's known munificence
Is ample warrant that no just pretence
Of mine for dowry will be disallowed;
Though his fair daughter's self, as I avowed
At starting, is my object. Nay, we'll go
Together down, sir. Notice Neptune, though,
Taming a sea-horse, thought a rarity,
Which Claus of Innsbruck cast in bronze for me!
In these last few lines of "My Last Duchess" there are two metaphors. In one, he compares the portrait of his last Duchess to a living person--we know she has died and she hangs on the wall "as if alive".
He is also comparing his dead Duchess to his future Duchess...it is subtle, but he is hinting that if the next Duchess is to have a longer life, she will not repeat the mistakes of his last Duchess whose "smiles were stopped altogether" since they displeased him. She did not smile only for the Duke, therefore she lost her ability to smile forever. The new girl had best only reserve her smiles for him and be very much like the statues and other items of property he has "collected".
Here is another example of a metaphor in some lines from "My Last Duchess":
Who'd stoop to blame
This sort of trifling? Even had you skill
In speech--(which I have not)--to make your will
Quite clear to such an one, and say, "Just this
Or that in you disgusts me; here you miss,
Or there exceed the mark"--and if she let
Herself be lessoned so, nor plainly set
Her wits to yours, forsooth, and made excuse,
--E'en then would be some stooping; and I choose
Never to stoop.
The Duke does not mean the words "stoop" and "stooping" literally but metaphorically. If he did try to reprimand his young wife his posture would undoubtedly remain rigid and erect, but he would consider it a kind of crouching or bowing, humbling himself, to try complaining, explaining and requesting. So "stoop" and "stooping" are metaphors as used in the poem.