ETA: It is VERY important to let all the staff know prior to your being admitted to the theatre that you are breastfeeding. I let EVERYONE know, as I was so paranoid they wouldn't allow me to have DD brought in to me and I knew she would be hungry. I think it's also very wise to speak with your Anethetist and tell him/her that you are wishing to feed bub as well and they can usually advise you on what you'll be given both meds wise, recovery wise and anesthetic wise and this can help determine what may or may not cross over into your milk etc.
It also doesn't hurt to have a support person with you (which I have no doubt you will with such major surgery) to help you when you're still under the effects of being under.
I also forgot to mention in my previous post that in answer to your question, no, I didn't find breastfeeding sore or painful after the surgery, however I didn't have heart surgery either. I think the meds I was on would have null and voided any pain as such.
It would be interesting to hear from others who have had heart surgery as to whether the feeding was painful due to the surgery being on the chest area? Perhaps the ABA might know?