When one swallows, the bolus of food presses upon the posterior aspect of tongue, it pushes the epiglottis downwards and backwards to completely seal off the laryngeal inlet so that none of the food enters the larynx.
Unfortunately, in your case, so food is trickling down the wrong way causing the violent coughing!
Next Steps
You need to locate a good ENT Surgeon who will evaluate your swallowing to find out why this is happening and then remedy the situation accordingly. The best diagnostic tool we have today is a flexible nasopharyngolaryngoscope which is inserted through your nostril and then you are made to swallow something and the whole event is visualised clearly from the nasopharynx.