How to install software from source and tell the apt-get that I have installed the version?

You can't. And in most cases, you shouldn't install a bare source tarball unless there's absolutely no other way. Use a package from Ubuntu, or build a source package from Debian, or anything else. You really want to use Debianized source.

However, you can build/modify a source package:

apt-get source some-package

Then, after making any changes, build a binary package:

cd source-directory
debuild -S

Now, you have a .deb package you can install.

EDIT: I belatedly remembered checkinstall. You can use checkinstall to replace the make install step. You'll get something that looks very much like your original question asked for, although the last time I worked with checkinstall (years ago) it was far from perfect. The other options I mentioned are better than this one.