Unable to Install/Uninstall a custom module
You should pay close attention to the Module developer's guide on Drupal.org.

To appear in the lists, the module should be placed in its own sub-directory like modules/modulename, and it must have a properly configured modulename.info file in addition to a file named modulename.module. 

If you have properly segregated the functions into the proper files, there should be no problem. Drupal will detect them automatically and will maintain an entry in the system table for the module. You should be able to activate or deactivate the module normally.

The installation routines (which are used to create or to remove the tables should be handled by functions in a modulename.install file. Drupal will look for the modulename.install file to see what tasks are required for installation or removal of the module.

My first advice would be to make sure that the module is correctly structured, and let Drupal handle the deactivation and uninstall, but you can do it manually if all else fails.

Deactivate the module and drop the tables using queries directly on the database. Start by looking for the definition in the system table.

UPDATE system SET status=0 WHERE type='module' AND name = 'modulename';


Then manually DROP any tables your module created and remove any variables it created.