I think Abhinav Gupta wrote a wonderful blog about , how to generate QR code in salesforce. You can find it here http://www.tgerm.com/2012/11/salesforce-qr-code-visualforce-contact.html
There are many online barcode generation websites on google. But if you want to generate barcode to an applictaion, a third-party barcode plug-in is needed. The common used is .net barcode genertor (http://www.keepdynamic.com/dotnet-barcode/) and java barcode generator (http://www.keepdynamic.com/java-barcode/). You can check the guide on them.
You can check the guide on them.