The steps are:
- Delete the pull subscription
- Delete the publication
Here are some links to assist you:
Both examples show how to delete the pull subscription and publication using SSMS, T-SQL, and RMO. T-SQL or RMO would be the way to go to do it programmatically. I hope this helps.