All first born males (Bekhoroth) have to fast the day before Pesah (Passover), even if they are Cohen or Levi (Kohanim or Lewiyim). It does not make a diference if they are the first born of the father or the mother.
This applies only to males. Women do not have the custom of fasting. Even if the male was born after a miscariage, he still has to fast. If the first born is a Hathan (bridegroom in the first week of his marriage), an Abi Habben (the father of a baby who is to have its Milah that day), or a Sandaq, he can eat and does not have to fast another day in its stead. A first-born who is doing a Pidyon Habben, however, to redeem his son on that day, has to fast.
Those who attend a Siyyum (conclusion) of a Masechta of a Gemarra, may eat there provided they understand what is being discussed. From this we see that someone who just "shows up" and pays no attention to the Siyyum, should not break his fast.
(See Ben Ish Hai, Shanah Aleph, Parashat Saw, Oth Kaf Heh)