AardVark's wild thought gave me some ideas and I figured out it myself. Solution itself is quite simple.
Here is the solution for anyone who might need similar solution.
After you have registered the bundles in ASP.NET MVC (Global.asax.cs or BundleConfig):
List<string> bundleHtml = new List<string>();
bundleHtml.Add(Scripts.Render("~/bundles/legacybase").ToString());
bundleHtml.Add(Styles.Render("~/styles/legacycss").ToString());
File.WriteAllLines(Server.MapPath("~/dyn_legacy_bundle.inc"), bundleHtml, System.Text.Encoding.UTF8);
This will generate file dyn_legacy_bundle.inc that contains the proper <script>
-tags that include the version hash (or debug versions if debug is enabled).
In Classic ASP (or some kinky PHP etc.):
<head>
<!--#include file="dyn_legacy_bundle.inc" -->
</head>
This will then use the file that was generated on startup by ASP.NET, and use the bundled css/javascript.
Negative thing is that if bundled files are changed on runtime, this dynamic file is not updated. That will cause bundles not to be cached. App pool recycle will eventually fix caching, so I think we will live with it. Let me know if you figure out way to avoid this.
Notice that this will work with any other framework also (ie. PHP)