Frameworks are useful for more than just web applications. Frameworks, like libraries, provide reusable code. The main difference? You call a library; a framework calls you.
I've written a few frameworks, including https://github.com/xBrite/armrest (a REST client framework that enables command-line interaction and acceptance testing). I will share principles, design patterns, techniques, and anti-patterns that I have found helpful in creating frameworks, which may help you to create your own framework.