Let's think about size -- a cow's heart is simply too large to be placed in the existing spot in a human. It is true that a baboon's heart was placed in a baby, but she survived just one day with the heart in place. It's not that the heart was not working, but rather that the tissues are simply too different.
Of course this was in 1984, before the highly-complex anti-rejection drugs of today. I have not found any information on if this has been considered in today's world.
As for a pig's heart -- they use valves from pigs to replace faulty human heart valves every single day. However, material from pigs in much shorter-lived than human material; after all, how long is a pig's life expectancy? The average life span is between 15-30 years, the mean being closer to 15.
Overall, the rejection and tissue differences are big enough issues to prevent whole-heart transplants. Researchers are much more interested in developing artificial organs or organ pieces, which hold much less chance of being rejected,and can last longer.