Contrary to Jobermark, I believe Kant provides a very straightforward answer to your dilemma. Kant's based his categorical imperative on one question "Is it universalizable?", and in your case the clear answer is vote for what you think is right for everybody (presumably in your case that is party B, since it would help more people than party A). Here's why:
- Based on your reasoning on why to vote for party A, a white person, even though he is not personally racist or bigoted in any way whatsoever, is still justified in voting for a white supremacist party, since after all they would advance his own interests and those of his family at the expense of those of others. This reason for voting is not acceptable, and so per Kant, any voting for special interests at the expense of general interests should be avoided, since if it were universalized, the above described voting for white supremacists scenario would be acceptable.
But then, you might ask, what about situations where there is an inevitable conflict of interest between different interests in one society? In particular, what about situations where the interests of a small group are inherently in conflict of those of the majority. How does one take into account such situations, yet still allow for a universal ethics of voting?
An answer was provided by Harvard political philosopher John Rawls, with his concept of the veil of ignorance, also explained in his idea of the original position. As described in this blog:
Imagine that you have set for yourself the task of developing a totally new social contract for today's society. How could you do so fairly? Although you could never actually eliminate all of your personal biases and prejudices, you would need to take steps at least to minimize them. Rawls suggests that you imagine yourself in an original position behind a veil of ignorance . Behind this veil, you know nothing of yourself and your natural abilities, or your position in society. You know nothing of your sex, race, nationality, or individual tastes. Behind such a veil of ignorance all individuals are simply specified as rational, free, and morally equal beings. You do know that in the "real world", however, there will be a wide variety in the natural distribution of natural assets and abilities, and that there will be differences of sex, race, and culture that will distinguish groups of people from each other.
John Rawls, basically asks to vote as if we didn't know anything about our place in society, i.e to vote from behind a veil of ignorance, when deciding what the fairest political system or distribution of resources should be.
Note that John Rawls is not a defender of income redistribution or total equality in a given society. Rawls finds inequality in a society perfectly acceptable, as long as it benefits everyone, including those least advantaged. See Rawls's second principle of justice as fairness. For example, it is acceptable, and maybe even preferable for doctors to be paid more money than most other professions, since this would guarantee that talented people would choose to be doctors, therefore increasing the well being and health of society as whole.
In response to the comment on utilitarianism
The standard text book definition of Utilitarianism is typically given as maximizing the happiness or the good over all people. For example John Stuart Mill states in his book Utilitarianism:
The only proof capable of being given that an object is visible, is that people actually see it. The only proof that a sound is audible, is that people hear it... In like manner, I apprehend, the sole evidence it is possible to produce that anything is desirable, is that people do actually desire it… No reason can be given why the general happiness is desirable, except that each person, so far as he believes it to be attainable, desires his own happiness… we have not only all the proof which the case admits of, but all which it is possible to require, that happiness is a good: that each person's happiness is a good to that person, and the general happiness, therefore, a good to the aggregate of all persons.
So it is pretty straightforward for a utilitarian as well, that you should vote for the greater good, not the special good. I don't know enough about utilitarianism to see how to it develop further or how to put it in to practice (How to measure the good? What about inherent conflicts? etc...).
In response to the comment about Marx:
Marx wouldn't have much to say about this dilemma, as his thought concerns economy more so than political theory qua politics (although there is inevitable overlap). To put it another way, Marx's ideas would be the end result of the voting process, not guidelines on how to vote.