Is there a way to delete related but undeleted files of removed applications? It's been like 2 years I've used Mac OS X, but I really don't like the way applications are managed, especially when we have to delete them, or when we update the operating system, XCode, or any vital program for making my Mac OS function properly.

I've deleted ignorantly many applications by just trashing them, but I've discovered that these applications could create other folders and files somewhere else, which I probably didn't delete.

My question are: 


Is there a way to delete all the related but undeleted files of removed applications? Like cached, configuration, etc, files.
Are there any folders where these applications usually store these files?


Note: in many cases I would not know anymore which applications I've deleted, so don't tell me to look in the official website of the application for a solution or a script that does it automatically. I'm looking for a more general solution.
I use a nice little free app called App Cleaner for the same reason/purpose. (I am not affiliated with AppCleaner. Note: I was asked by Dan to insert a disclaimer when suggesting a product I am not affiliated with.)

It has been very effective in finding and deleting all associated files and gives you the option to view and deselect certain files, if needed, prior to deletion.

The App Cleaner is available on the App Store.

From the developer:


  Main Advantage: App Cleaner deletes Remains (or leftovers) - files of
  previously removed apps. Thus, you uninstall applications completely.
  
  Main Features: 
  
  
  Scan the system and preview installed applications
  Remove all types of service files
  Remove remains of previously uninstalled apps  
  Reset application to a first-launch state
  Easy-to-use shortcuts
  Any file or app quick preview
  Specific app-associated file formats preview
  In-app help assistance
  Show unused applications
  Skip list option
  
  
  How to Uninstall an application using App Cleaner:
  
  
  Launch App Cleaner.
  Scan all applications for service files.
  Choose unneeded application (left view). In-app purchase required.
  Select all its service files on right view.
  Click Remove.
  If some apps were not removed, due to access rights, switch to Finder and move them manually to Trash.