I figured out this skill is like a muscle; use it or lose it. The more I put myself out there and greeted people and actively listened to them, the greater my recall ability strengthened over time. Personally, it helps me recall better if I take an active, compassionate interest in the person; somehow, the emotion makes the recall more persistent for me, but YMMV on what techniques help.
If you are raising young children, I've read that you start this skill early by asking the children before each party/gathering that they are expected to learn the name of one new person they have never met before, learn one fact about that new person, and remember the names of everyone they already know from before (children's parties usually are planned enough that a list of most everyone is known in advance, making this part easier). After the party, the children then describe everyone they met, the one new person they met, and what they talked about.