The problem is that YOU FEEL they only contact you for their own interest - such as when they need something from you. There are 2 situations here:
- This person would like to see you more times as friends, but because of circumstances this doesn't happen frequently. However, when she needs something, she contacts you even if normally she doesn't because of lack of time - or any other reason.
- This person doesn't have any interest at all in seeing you as friends and she indeed only wants to get something she needs from you.
In the second case, your feeling is completely right: this person is using you, and nobody likes that. In the first case, your feeling is (at least partially) mistaken: this person doesn't intend to use you.
In the second case, you shouldn't help this person, since she is not really your friend (even if you thought she was). You don't need to be honest with this person: it is not very polite to say "I don't want to help you", even if you have good reasons for it. You can invent some excuses to not help her, like lack of time, or any other. This excuse doesn't need to be a REALLY good excuse, it is enough that the other person doesn't know if you really can't help her or if you don't want to. It is even better if she suspects that you don't want to, because she will stop asking you for favors (if not the first time you refuse to help her, maybe the second or the third).
To know if someone is in the first or in the second case, you can try to resume your relationship, trying to see her more frequently. If you see that the other person is still interested in seeing you, you won't have that bad feeling about her asking for your help, because you will know that she's in the first case.
If you see that someone is interested in seeing you but you can't because of lack of time, distance, etc. you can choose if you help her or not (you can use the same method written above to refuse), but you will know she's still your friend and you will neither have that bad feeling.
If you see that someone is not interested in seeing you nor in being your friend, they're in the second case, so refuse to help her as explained above.
EDIT:
Other answers suggest to ask for another favor in return. I think this is not the best approach because friends don't make favors just to get another one in return. Because of this, with this method you will stop people who only want to get something for you, but you can make people who is your friend feeling that you only will help them to get something in return, so they will think you are not a good friend.
However, they suggest requesting to have a beer or a lunch as examples of the favor you can request in return. This is a good approach, because you are requesting friendship in return, not another favor, which is clearly a fair request. This will also allow you to check who wants to spend some time with you and who doesn't want.
What I mean is that saying "request a favor in return, for example having lunch with her" includes the possibility to request a different thing in return. It would be better to say "request to spend some time with her in return, for example having lunch".